/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.softnight.db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author Franklin
 */
public class DBUtil {
    public static Long nextID() throws SQLException {
        Long id = null;
        
        Connection conn = ConnectionFactory.getConnection();
        Statement stmt = conn.createStatement();
        ResultSet rs = stmt.executeQuery("select nextval('sequence_id')");
        if (rs.next()) {
            id = rs.getLong("nextval");
        }
        return id;
    }
}
